﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Theme</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        var spreadNS = GcSpread.Sheets;
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 1 });

            var sheet = spread.getActiveSheet();
            sheet.setSelection(2, 2, 3, 4);

            $("#spreadThemes").change(function () {
                var target = $("link[href*='gcspread.sheets']")[0];
                if (target) {
                    var $target = $(target),
                        href = $target.attr("href"),
                        pos = href.indexOf("gcspread.sheets");

                    // update css link file
                    $target.attr("href", href.substr(0, pos) + this.value);

                    // wait loading file then refresh spread to apply new theme
                    setTimeout(function () {
                        spread.refresh();
                    }, 500);
                }
            });
        });
    /*code_end*/
    </script>
</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:300px;border: 1px solid gray;"></div>
    <div class="demo-options">
        <div class="option-row">
            <label style="margin-right: 10px">Spread Theme:</label>
            <select id="spreadThemes">
                <optgroup label="SpreadJS">
                    <option value="gcspread.sheets.9.40.20161.0.css">SpreadJS</option>
                </optgroup>
                <optgroup label="Excel2013">
                    <option value="gcspread.sheets.excel2013white.9.40.20161.0.css" selected="selected">White</option>
                    <option value="gcspread.sheets.excel2013lightGray.9.40.20161.0.css">Light Gray</option>
                    <option value="gcspread.sheets.excel2013darkGray.9.40.20161.0.css">Dark Gray</option>
                </optgroup>
                <optgroup label="Excel2016">
                    <option value="gcspread.sheets.excel2016colorful.9.40.20161.0.css">Colorful</option>
                    <option value="gcspread.sheets.excel2016darkGray.9.40.20161.0.css">Dark Gray</option>
                </optgroup>
            </select>
        </div>
    </div>
</div>
</body>
</html>